package com.ruoyi.lvlian.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;
import java.util.List;

/**
 * 组织领域对象 sys_organization_domain
 *
 * @author ruoyi
 * @date 2024-08-29
 */
public class SysOrganizationDomain {
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    private String id;

    /**
     * 名称
     */
    @Excel(name = "名称")
    private String label;

    /**
     * 编码
     */
    @Excel(name = "编码")
    private String code;

    /**
     * 父key
     */
    private String parentId;
    private String parentName;
    /**
     * 领域还是组织
     */
    @Excel(name = "领域还是组织 公司，账本")
    private String category;


    @Excel(name = "业务领域公司")
    private String[] deptNames;


    private Long userId;

    private List<SysOrganizationDomain> children; // 子节点列表，用于构建树形结构
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdAt;

    private String createUser;


    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }



    public void setCode(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getParentId() {
        return parentId;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getCategory() {
        return category;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("code", getCode())
                .append("parentId", getParentId())
                .append("category", getCategory())
                .append("createdAt", getCreatedAt())
                .toString();
    }

    public String[] getDeptNames() {
        return deptNames;
    }

    public void setDeptNames(String[] deptNames) {
        this.deptNames = deptNames;
    }

    public List<SysOrganizationDomain> getChildren() {
        return children;
    }

    public void setChildren(List<SysOrganizationDomain> children) {
        this.children = children;
    }


    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }
}
